<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Global Body Planner: include/global_body_planner/terrain_map_publisher.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Global Body Planner
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_94ddb28d1a8f6d812dff56d903a1ce15.html">global_body_planner</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">terrain_map_publisher.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#ifndef TERRAIN_MAP_PUBLISHER_H</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#define TERRAIN_MAP_PUBLISHER_H</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;</div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#include &lt;ros/ros.h&gt;</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#include &lt;grid_map_core/grid_map_core.hpp&gt;</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#include &lt;grid_map_ros/grid_map_ros.hpp&gt;</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#include &lt;grid_map_ros/GridMapRosConverter.hpp&gt;</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#include &lt;ros/package.h&gt;</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;</div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#include &lt;sstream&gt;</span> <span class="comment">//istringstream</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#include &lt;iostream&gt;</span> <span class="comment">// cout</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#include &lt;fstream&gt;</span> <span class="comment">// ifstream</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;</div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;</div><div class="line"><a name="l00020"></a><span class="lineno"><a class="line" href="classTerrainMapPublisher.html">   20</a></span>&#160;<span class="keyword">class </span><a class="code" href="classTerrainMapPublisher.html">TerrainMapPublisher</a> {</div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;  <a class="code" href="classTerrainMapPublisher.html#a0a8d623893002835ad1efd85b2fd321b">TerrainMapPublisher</a>(ros::NodeHandle nh);</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classTerrainMapPublisher.html#a295ac03389590d98c589d2d58990b64e">createMap</a>();</div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;  std::vector&lt;std::vector&lt;double&gt; &gt; <a class="code" href="classTerrainMapPublisher.html#ad3f41fb79f4056c0c7a145f3c0061786">loadCSV</a>(std::string filename);</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;</div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classTerrainMapPublisher.html#a633f664cc608dc2478948c829c22c97d">loadMapFromCSV</a>();</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classTerrainMapPublisher.html#a5d8c63f68d1256f06db6159876ce2100">loadMapFromImage</a>(<span class="keyword">const</span> sensor_msgs::Image&amp; msg);</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classTerrainMapPublisher.html#aa11b7631c0f0c3c33f9a118be181a102">publishMap</a>();</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classTerrainMapPublisher.html#a05d219e0cf2b9684029f79e3ec8de424">spin</a>();</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;</div><div class="line"><a name="l00065"></a><span class="lineno"><a class="line" href="classTerrainMapPublisher.html#abb161fa5dcd81d1ef132b29e0ebe9a29">   65</a></span>&#160;  ros::Subscriber <a class="code" href="classTerrainMapPublisher.html#abb161fa5dcd81d1ef132b29e0ebe9a29">image_sub_</a>;</div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;</div><div class="line"><a name="l00068"></a><span class="lineno"><a class="line" href="classTerrainMapPublisher.html#a0a60e93d610ec49cff3ddac21e0c164b">   68</a></span>&#160;  ros::Publisher <a class="code" href="classTerrainMapPublisher.html#a0a60e93d610ec49cff3ddac21e0c164b">terrain_map_pub_</a>;</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;</div><div class="line"><a name="l00071"></a><span class="lineno"><a class="line" href="classTerrainMapPublisher.html#ae99cba5723122187783469f150268630">   71</a></span>&#160;  ros::NodeHandle <a class="code" href="classTerrainMapPublisher.html#ae99cba5723122187783469f150268630">nh_</a>;</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;</div><div class="line"><a name="l00074"></a><span class="lineno"><a class="line" href="classTerrainMapPublisher.html#a0acbdc1ceea7069aaef82f4c18388fb2">   74</a></span>&#160;  <span class="keywordtype">double</span> <a class="code" href="classTerrainMapPublisher.html#a0acbdc1ceea7069aaef82f4c18388fb2">update_rate_</a>;</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;</div><div class="line"><a name="l00077"></a><span class="lineno"><a class="line" href="classTerrainMapPublisher.html#ab72c50bd278bec6f1870d7098f1f1eed">   77</a></span>&#160;  std::string <a class="code" href="classTerrainMapPublisher.html#ab72c50bd278bec6f1870d7098f1f1eed">map_frame_</a>;</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;</div><div class="line"><a name="l00080"></a><span class="lineno"><a class="line" href="classTerrainMapPublisher.html#a87ef6e36fae57a1e151014937ee3d02f">   80</a></span>&#160;  grid_map::GridMap <a class="code" href="classTerrainMapPublisher.html#a87ef6e36fae57a1e151014937ee3d02f">terrain_map_</a>;</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;</div><div class="line"><a name="l00083"></a><span class="lineno"><a class="line" href="classTerrainMapPublisher.html#aac004d967077b8433018cdcf6f51c384">   83</a></span>&#160;  std::string <a class="code" href="classTerrainMapPublisher.html#aac004d967077b8433018cdcf6f51c384">map_data_source_</a>;</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;</div><div class="line"><a name="l00086"></a><span class="lineno"><a class="line" href="classTerrainMapPublisher.html#a86d3497f911cbec8d7d250cfce4d403a">   86</a></span>&#160;  std::string <a class="code" href="classTerrainMapPublisher.html#a86d3497f911cbec8d7d250cfce4d403a">terrain_type_</a>;</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;</div><div class="line"><a name="l00089"></a><span class="lineno"><a class="line" href="classTerrainMapPublisher.html#acde2f6690426b3aa1de411b260f5517b">   89</a></span>&#160;  <span class="keywordtype">bool</span> <a class="code" href="classTerrainMapPublisher.html#acde2f6690426b3aa1de411b260f5517b">map_initialized_</a> = <span class="keyword">false</span>;</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;</div><div class="line"><a name="l00092"></a><span class="lineno"><a class="line" href="classTerrainMapPublisher.html#a01d73a9b142c5cd7457feb50045dc370">   92</a></span>&#160;  <span class="keywordtype">double</span> <a class="code" href="classTerrainMapPublisher.html#a01d73a9b142c5cd7457feb50045dc370">resolution_</a>;</div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;</div><div class="line"><a name="l00095"></a><span class="lineno"><a class="line" href="classTerrainMapPublisher.html#aa22f46f8003f8963e383f342387c09dc">   95</a></span>&#160;  <span class="keywordtype">double</span> <a class="code" href="classTerrainMapPublisher.html#aa22f46f8003f8963e383f342387c09dc">min_height_</a>;</div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;</div><div class="line"><a name="l00098"></a><span class="lineno"><a class="line" href="classTerrainMapPublisher.html#af6938ddec68646380135b2d22b7a2498">   98</a></span>&#160;  <span class="keywordtype">double</span> <a class="code" href="classTerrainMapPublisher.html#af6938ddec68646380135b2d22b7a2498">max_height_</a>;</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;};</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;<span class="preprocessor">#endif // TERRAIN_MAP_PUBLISHER_H</span></div><div class="ttc" id="classTerrainMapPublisher_html_ad3f41fb79f4056c0c7a145f3c0061786"><div class="ttname"><a href="classTerrainMapPublisher.html#ad3f41fb79f4056c0c7a145f3c0061786">TerrainMapPublisher::loadCSV</a></div><div class="ttdeci">std::vector&lt; std::vector&lt; double &gt; &gt; loadCSV(std::string filename)</div><div class="ttdoc">Loads data from a specified CSV file into a nested std::vector structure. </div><div class="ttdef"><b>Definition:</b> terrain_map_publisher.cpp:66</div></div>
<div class="ttc" id="classTerrainMapPublisher_html_aa22f46f8003f8963e383f342387c09dc"><div class="ttname"><a href="classTerrainMapPublisher.html#aa22f46f8003f8963e383f342387c09dc">TerrainMapPublisher::min_height_</a></div><div class="ttdeci">double min_height_</div><div class="ttdoc">Double for map resolution. </div><div class="ttdef"><b>Definition:</b> terrain_map_publisher.h:95</div></div>
<div class="ttc" id="classTerrainMapPublisher_html_aa11b7631c0f0c3c33f9a118be181a102"><div class="ttname"><a href="classTerrainMapPublisher.html#aa11b7631c0f0c3c33f9a118be181a102">TerrainMapPublisher::publishMap</a></div><div class="ttdeci">void publishMap()</div><div class="ttdoc">Publishes map data to the terrain_map topic. </div><div class="ttdef"><b>Definition:</b> terrain_map_publisher.cpp:175</div></div>
<div class="ttc" id="classTerrainMapPublisher_html_a01d73a9b142c5cd7457feb50045dc370"><div class="ttname"><a href="classTerrainMapPublisher.html#a01d73a9b142c5cd7457feb50045dc370">TerrainMapPublisher::resolution_</a></div><div class="ttdeci">double resolution_</div><div class="ttdoc">Double for map resolution. </div><div class="ttdef"><b>Definition:</b> terrain_map_publisher.h:92</div></div>
<div class="ttc" id="classTerrainMapPublisher_html_a05d219e0cf2b9684029f79e3ec8de424"><div class="ttname"><a href="classTerrainMapPublisher.html#a05d219e0cf2b9684029f79e3ec8de424">TerrainMapPublisher::spin</a></div><div class="ttdeci">void spin()</div><div class="ttdoc">Calls ros spinOnce and pubs data at set frequency. </div><div class="ttdef"><b>Definition:</b> terrain_map_publisher.cpp:186</div></div>
<div class="ttc" id="classTerrainMapPublisher_html"><div class="ttname"><a href="classTerrainMapPublisher.html">TerrainMapPublisher</a></div><div class="ttdoc">A terrain map publishing class. </div><div class="ttdef"><b>Definition:</b> terrain_map_publisher.h:20</div></div>
<div class="ttc" id="classTerrainMapPublisher_html_acde2f6690426b3aa1de411b260f5517b"><div class="ttname"><a href="classTerrainMapPublisher.html#acde2f6690426b3aa1de411b260f5517b">TerrainMapPublisher::map_initialized_</a></div><div class="ttdeci">bool map_initialized_</div><div class="ttdoc">Bool to flag if the map has been initialized yet. </div><div class="ttdef"><b>Definition:</b> terrain_map_publisher.h:89</div></div>
<div class="ttc" id="classTerrainMapPublisher_html_a295ac03389590d98c589d2d58990b64e"><div class="ttname"><a href="classTerrainMapPublisher.html#a295ac03389590d98c589d2d58990b64e">TerrainMapPublisher::createMap</a></div><div class="ttdeci">void createMap()</div><div class="ttdoc">Creates the map object from scratch. </div><div class="ttdef"><b>Definition:</b> terrain_map_publisher.cpp:34</div></div>
<div class="ttc" id="classTerrainMapPublisher_html_a0a60e93d610ec49cff3ddac21e0c164b"><div class="ttname"><a href="classTerrainMapPublisher.html#a0a60e93d610ec49cff3ddac21e0c164b">TerrainMapPublisher::terrain_map_pub_</a></div><div class="ttdeci">ros::Publisher terrain_map_pub_</div><div class="ttdoc">ROS Publisher for the terrain map. </div><div class="ttdef"><b>Definition:</b> terrain_map_publisher.h:68</div></div>
<div class="ttc" id="classTerrainMapPublisher_html_a87ef6e36fae57a1e151014937ee3d02f"><div class="ttname"><a href="classTerrainMapPublisher.html#a87ef6e36fae57a1e151014937ee3d02f">TerrainMapPublisher::terrain_map_</a></div><div class="ttdeci">grid_map::GridMap terrain_map_</div><div class="ttdoc">GridMap object for terrain data. </div><div class="ttdef"><b>Definition:</b> terrain_map_publisher.h:80</div></div>
<div class="ttc" id="classTerrainMapPublisher_html_a633f664cc608dc2478948c829c22c97d"><div class="ttname"><a href="classTerrainMapPublisher.html#a633f664cc608dc2478948c829c22c97d">TerrainMapPublisher::loadMapFromCSV</a></div><div class="ttdeci">void loadMapFromCSV()</div><div class="ttdoc">Loads data into the map object from a CSV. </div><div class="ttdef"><b>Definition:</b> terrain_map_publisher.cpp:106</div></div>
<div class="ttc" id="classTerrainMapPublisher_html_aac004d967077b8433018cdcf6f51c384"><div class="ttname"><a href="classTerrainMapPublisher.html#aac004d967077b8433018cdcf6f51c384">TerrainMapPublisher::map_data_source_</a></div><div class="ttdeci">std::string map_data_source_</div><div class="ttdoc">String of the source of the terrain map data. </div><div class="ttdef"><b>Definition:</b> terrain_map_publisher.h:83</div></div>
<div class="ttc" id="classTerrainMapPublisher_html_ae99cba5723122187783469f150268630"><div class="ttname"><a href="classTerrainMapPublisher.html#ae99cba5723122187783469f150268630">TerrainMapPublisher::nh_</a></div><div class="ttdeci">ros::NodeHandle nh_</div><div class="ttdoc">Nodehandle to pub to and sub from. </div><div class="ttdef"><b>Definition:</b> terrain_map_publisher.h:71</div></div>
<div class="ttc" id="classTerrainMapPublisher_html_a5d8c63f68d1256f06db6159876ce2100"><div class="ttname"><a href="classTerrainMapPublisher.html#a5d8c63f68d1256f06db6159876ce2100">TerrainMapPublisher::loadMapFromImage</a></div><div class="ttdeci">void loadMapFromImage(const sensor_msgs::Image &amp;msg)</div><div class="ttdoc">Loads data into the map object from an image topic. </div><div class="ttdef"><b>Definition:</b> terrain_map_publisher.cpp:148</div></div>
<div class="ttc" id="classTerrainMapPublisher_html_abb161fa5dcd81d1ef132b29e0ebe9a29"><div class="ttname"><a href="classTerrainMapPublisher.html#abb161fa5dcd81d1ef132b29e0ebe9a29">TerrainMapPublisher::image_sub_</a></div><div class="ttdeci">ros::Subscriber image_sub_</div><div class="ttdoc">ROS Subscriber for image data. </div><div class="ttdef"><b>Definition:</b> terrain_map_publisher.h:65</div></div>
<div class="ttc" id="classTerrainMapPublisher_html_a0acbdc1ceea7069aaef82f4c18388fb2"><div class="ttname"><a href="classTerrainMapPublisher.html#a0acbdc1ceea7069aaef82f4c18388fb2">TerrainMapPublisher::update_rate_</a></div><div class="ttdeci">double update_rate_</div><div class="ttdoc">Update rate for sending and receiving data, unused since pubs are called in callbacks. </div><div class="ttdef"><b>Definition:</b> terrain_map_publisher.h:74</div></div>
<div class="ttc" id="classTerrainMapPublisher_html_af6938ddec68646380135b2d22b7a2498"><div class="ttname"><a href="classTerrainMapPublisher.html#af6938ddec68646380135b2d22b7a2498">TerrainMapPublisher::max_height_</a></div><div class="ttdeci">double max_height_</div><div class="ttdoc">Double for map resolution. </div><div class="ttdef"><b>Definition:</b> terrain_map_publisher.h:98</div></div>
<div class="ttc" id="classTerrainMapPublisher_html_a0a8d623893002835ad1efd85b2fd321b"><div class="ttname"><a href="classTerrainMapPublisher.html#a0a8d623893002835ad1efd85b2fd321b">TerrainMapPublisher::TerrainMapPublisher</a></div><div class="ttdeci">TerrainMapPublisher(ros::NodeHandle nh)</div><div class="ttdoc">Constructor for TerrainMapPublisher Class. </div><div class="ttdef"><b>Definition:</b> terrain_map_publisher.cpp:3</div></div>
<div class="ttc" id="classTerrainMapPublisher_html_a86d3497f911cbec8d7d250cfce4d403a"><div class="ttname"><a href="classTerrainMapPublisher.html#a86d3497f911cbec8d7d250cfce4d403a">TerrainMapPublisher::terrain_type_</a></div><div class="ttdeci">std::string terrain_type_</div><div class="ttdoc">String of terrain type (if loading from csv) </div><div class="ttdef"><b>Definition:</b> terrain_map_publisher.h:86</div></div>
<div class="ttc" id="classTerrainMapPublisher_html_ab72c50bd278bec6f1870d7098f1f1eed"><div class="ttname"><a href="classTerrainMapPublisher.html#ab72c50bd278bec6f1870d7098f1f1eed">TerrainMapPublisher::map_frame_</a></div><div class="ttdeci">std::string map_frame_</div><div class="ttdoc">Handle for the map frame. </div><div class="ttdef"><b>Definition:</b> terrain_map_publisher.h:77</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
